package com.soft.javase.day09;

import java.util.Comparator;
import java.util.TreeSet;

/**
 * @author yzg
 * @desc TODO
 * @date 2025/4/29
 */
public class StringSort {
    public static void main(String[] args) {
        String str="8 10 15 5 2 7";
        String[] split = str.split("\\s+");
        TreeSet<Integer> set = new TreeSet<>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return Integer.compare(o1, o2);
            }
        });
        for (String s : split) {
            set.add(Integer.valueOf(s));
        }
        System.out.println(set);
    }
}
